import time
qwe1 = open('m1_sorted.txt','r')
sp1 = qwe1.readlines()
asd = True
t_start1 = time.time()
while asd:
    asd = False
    for  i in range(len(sp1)-1):
        if sp1[i] > sp1[i + 1]:
           sp1[i], sp1[i + 1] = sp1[i + 1], sp1[i]
           asd = False
t_con1 = time.time()
qwertt = round((t_con1-t_start1)*1000, 2)
print("m1_sorted", qwertt, "milliseconds")

asd2 = True
qwe2 = open('m2_reverse.txt','r')
sp2 = qwe2.readlines()
t_start2 = time.time()
while asd2:
    asd2 = False
    for  i in range(len(sp2)-1):
        if sp2[i] > sp2[i + 1]:
           sp2[i], sp2[i + 1] = sp2[i + 1], sp2[i]
           asd2 = False
t_con2 = time.time()
qwertt = round((t_con2-t_start2)*1000, 2)
print("m1_sorted", qwertt, "milliseconds")

asd3 = True
qwe3 = open('m3_shuffle.txt','r')
sp3 = qwe3.readlines()
t_start3 = time.time()
while asd3:
    asd3 = False
    for  i in range(len(sp3)-1):
        if sp3[i] > sp3[i + 1]:
           sp3[i], sp3[i + 1] = sp3[i + 1], sp3[i]
           asd3 = False
t_con3 = time.time()
qwertt = round((t_con3-t_start3)*1000, 2)
print("m1_sorted", qwertt, "milliseconds")

